@import "../../styles/_variables";
@import "../../styles/_mixins";

.settings-panel {
  flex-shrink: 0;
  overflow: auto;
  font-size: 14px;
  display: flex;
  border-right: 1px solid var(--playground-border);
  background-color: var(--container-color);

  @include dark-mode {
    background-color: rgba(255, 255, 255, 0.2);
  }

  .fields {
    width: 250px;
    height: 100%;
    overflow: auto;
  }

  .collapser {
    width: 5px;
    height: 100%;
    background-color: var(--hard-border-color);
    flex-shrink: 0;
    opacity: 0.5;
    cursor: w-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;

    .dot {
      width: 3px;
      height: 3px;
      background-color: rgba(#000, 50%);
      border-radius: 50%;
    }

    &.collapsed {
      width: 10px;
      cursor: e-resize;

      .dot {
        width: 5px;
        height: 5px;
      }
    }

    &:hover {
      opacity: 1;
    }
  }
}

.settings-tab-buttons {
  display: flex;
  gap: 10px;
}

.settings-tab {
  section {
    padding: 10px;
  }

  input[type=checkbox] {
    margin-right: 10px;
  }

  select, input[type=number] {
    width: 110px;
  }

  select, input[type=number], .input-container {
    margin-left: auto;
  }

  .input-container {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: auto;
  }

  input[type=text], input[type=number] {
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 2px 10px;

    @include dark-mode {
      color: inherit;
      background-color: rgba(255, 255, 255, 0.3);
      border-color: rgba(0, 0, 0, 0.5);
    }
  }

  select {
    @include button;
    border-radius: 6px;
    padding: 2px 6px;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.2);

    @include dark-mode {
      border-color: rgba(255, 255, 255, 0.1);
    }
  }


  button {
    @include button;
    border-radius: 0;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    color: inherit;
    border-radius: 6px;
    cursor: pointer;

    @include dark-mode {
      border-color: rgba(255, 255, 255, 0.1);
    }

    &:disabled {
      opacity: 0.5;
      font-weight: bold;
    }
  }

  .button-group button {
    border-radius: 0;

    &:disabled:not(:last-child) {
      border-right: none;
    }

    &:not(:first-child):not(&:disabled + button) {
      border-left: none;
    }

    &:first-child {
      border-top-left-radius: 6px;
      border-bottom-left-radius: 6px;
    }

    &:last-child {
      border-top-right-radius: 6px;
      border-bottom-right-radius: 6px;
    }
  }

  .field-row {
    display: flex;
    line-height: 25px;
    margin-bottom: 10px;

    label {
      width: 100%;
    }

    &.disabled {
      opacity: 0.4;

      &, * {
        cursor: not-allowed;
      }
    }
  }
}

.react-tabs__tab-panel .settings-panel {
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.file-view {
  padding-bottom: 10px;

  .files-heading {
    display: flex;
    align-items: center;

    button {
      margin-left: auto;
    }
  }

  > input[type=text] {
    display: block;
    padding: 5px;
    margin: 5px;
    margin-bottom: 0;
  }

  .files-list {
    padding-top: 10px;

    li {
      display: flex;
      align-items: center;
      padding: 0 10px;
      cursor: pointer;
      line-height: 30px;
      height: 30px;

      &:hover {
        background: rgba(#000, 5%);

        button {
          display: block;
          opacity: 0.8;
        }
      }

      &.active {
        font-weight: bold;
        background: rgba(#000, 10%);
      }

      button {
        display: none;
        margin-left: auto;

        &:hover {
          opacity: 1;
        }
      }
    }
  }
}
